package com.cn.wanxi.controller;

import com.cn.wanxi.entity.NavEntity;
import com.cn.wanxi.entity.ResultEntity;
import com.cn.wanxi.service.INavService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/back/nav")
public class NavController {
    @Autowired
    private INavService navService;

    @RequestMapping("/add")
    protected ResultEntity add(NavEntity navEntity){
        return navService.add(navEntity);
    }

    @RequestMapping("/del")
    protected ResultEntity delete(NavEntity navEntity){
        return navService.delete(navEntity);
    }

    @RequestMapping("/get")
    protected ResultEntity findAll(NavEntity navEntity){
        return ResultEntity.success(navService.findAll(navEntity));
    }

    @RequestMapping("/id")
    protected ResultEntity findById(NavEntity navEntity){
        return navService.findById(navEntity);
    }

    @RequestMapping("/post")
    protected ResultEntity update(NavEntity navEntity){
        return navService.update(navEntity);
    }
}
